package com.upf1sh.controller;

import com.upf1sh.service.PersonLocationService;
import com.upf1sh.utils.Result;
import com.upf1sh.vo.PageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/personLocation")
public class PersonLocationController {

    @Autowired
  private   PersonLocationService personLocationService;

    @GetMapping("/selectPersonLocationData")
    public Result selectPersonLocationData(Integer pageNumber,Integer pageSize) {
        PageVO pageVO = personLocationService.selectPersonLocationData(pageNumber,pageSize);
        return Result.ok().data("data",pageVO);
    }

    @PostMapping
    public Result get(){
        boolean b = personLocationService.get();
        if(b){
            return Result.ok();
        }else {
            return Result.error();
        }
    }
}
